package com.chenhy.springbootvuesmbms.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;


@Data
@NoArgsConstructor
@AllArgsConstructor
public class CommonResult<T> implements Serializable {

    // 404 not found
    private Integer code;
    private String message;
    private T data;

    public CommonResult(Integer code, String message){
        this(code,message,null);
    }


    public static CommonResult success(){
        return new CommonResult(200,"success");
    }

    public static CommonResult error(){
        return new CommonResult(444,"error");
    }

}